//调用接口配置文件
import { request } from 'config/request'
// 定义接口
//获取商品列表
export async function getList (params) {
  return request({
    url: 'admin/seckill/queryProductList',
    method: 'POST',
    headers: {
      'Content-type': 'application/json'
    },
    data: params
  })
}

//获取商品详情
export async function getDetail (params) {
  return request({
    url: `admin/seckill/queryDetail/${params.id}`,
    method: 'GET',
    data: params
  })
}
//下架
export async function relieveTimeSlot (params) {
  return request({
    url: `admin/seckill/relieveTimeSlot`,
    method: 'POST',
    headers: {
      'Content-type': 'application/json'
    },
    data: params
  })
}
//删除
export async function deleteItem (params) {
  return request({
    url: `admin/seckill/deletedSeckillProduct`,
    method: 'POST',
    headers: {
      'Content-type': 'application/json'
    },
    data: params
  })
}

//模板下载
export async function downloadTemplate (params) {
  return request({
    url: `admin/seckill/downloadTemplate`,
    method: 'POST',
    headers: {
      'Content-type': 'application/x-www-form-urlencoded'
    },
    data: params
  })
}

//导出
export async function exportFile (params) {
  return request({
    url: `admin/seckill/importFile`,
    method: 'POST',
    headers: {
      'Content-type': 'application/x-www-form-urlencoded'
    },
    data: params
  })
}

//导入
export async function importFile (params) {
  return request({
    url: 'admin/seckill/import',
    method: 'POST',
    headers: {
      'Content-type': 'application/x-www-form-urlencoded'
    },
    data: params
  })
}
